import request from "@/utils/request.ts";


// 获取专栏信息
export function getCategoryAllUrl() {
    return request({
        url: '/blog/category/all',
        method: 'get',
    })
}


export function addCategoryUrl(data: any) {
    return request({
        url: '/blog/category/add',
        method: 'post',
        data
    })
}

/**
 * 修改专栏信息
 * @param data
 * @param data.bcId 专栏 id
 * @param data.bcName 专栏名称
 * @param data.sort 排序
 * @param data.status 状态
 * @returns
 */
export function editCategoryUrl(data: any) {
    return request({
        url: '/blog/category/update',
        method: 'put',
        data
    })
}


export function removeCategoryByIdUrl(bcId: number) {
    return request({
        url: '/blog/category/remove',
        method: 'delete',
        params: {bcId}
    })
}


/**
 * 获取全部的分类和标签
 */
export function getAllCateGoryAndTagsUrl() {
    return request({
        url: '/blog/category/cateGoryAndTags',
        method: 'get',
    })
}
